
import java.io.*;

import common.utils.OCRUtils;
import net.sourceforge.tess4j.ITesseract;
import net.sourceforge.tess4j.Tesseract;
import net.sourceforge.tess4j.TesseractException;


/**
 * Created by Administrator on 2017/8/4.
 */
public class OCRDemo {
    public static void main(String[] args) throws TesseractException {
        File imgDir = new File("e://tmp/code");
        //对img_data文件夹中的每个验证码进行识别
        //文件名即正确的结果
        for (File imgFile : imgDir.listFiles()) {
            //输出图片文件名，即正确识别结果
            System.out.println("ImgFile: "+imgFile.getAbsolutePath());
            //输出识别结果
            System.out.println("OCR Result: " + OCRUtils.ocr(imgFile));
        }
    }
}
